package com.xbongbong.admin.domain.dao;

import com.xbongbong.admin.domain.entity.FormInstallEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * @author guohui.zhang
 * @Title: 表单安装信息
 * @Package
 * @Description:
 * @date 2020/3/1219:38
 */
@Repository
@Mapper
public interface FormInstallDao {
    /**
     * 插入数据
     * @param entity 实体
     * @author xingxing.xiao
     * @date 2020/01/09 09:54
     */
    Integer insert(FormInstallEntity entity);

    /**
     * 更新实例
     * @param entity 实体
     * @author xingxing.xiao
     * @date 2020/01/09 09:54
     */
    Integer update(FormInstallEntity entity);

    /**
     * 删除实体
     * @param key 主键id
     * @author xingxing.xiao
     * @date 2020/01/09 10:05
     */
    Integer deleteByKey(@Param("key") Long key, @Param("corpid") String corpid);

    /**
     * 获取实体
     * @param key 主键id
     * @author xingxing.xiao
     * @date 2020/01/09 10:04
     */
    FormInstallEntity getByKey(@Param("key") Long key, @Param("corpid") String corpid);

    /**
     * 查询列表
     * @param param
     * @author xingxing.xiao
     * @date 2020/01/09 09:55
     */
    List<FormInstallEntity> findEntitys(@Param("param") Map<String, Object> param);

    /**
     * 获取符合查询条件的记录总数
     *
     * @param param 条件
     * @author xingxing.xiao
     * @date 2019/11/25 17:33
     */
    Integer getEntitysCount(@Param("param") Map<String, Object> param);
    /**
     * 获取镜像应用信息
     * @param mirrorId
     * @author xingxing.xiao
     * @date 2019/11/25 17:33
     */
    FormInstallEntity getByMirrorId(@Param("mirrorId") Long mirrorId, @Param("corpid") String corpid);

    /**
     * 获取镜像应用信息
     * @param appId
     * @author xingxing.xiao
     * @date 2019/11/25 17:33
     */
    FormInstallEntity getByAppId(@Param("appId") Long appId, @Param("corpid") String corpid);

    /**
     * 批量更新
     */
    Integer updateBatch(@Param("list") List<FormInstallEntity> appInstallEntityList);

    /**
     * 批量插入
     * @param list
     */
    Integer insertBatch(@Param("list") List<FormInstallEntity> list);

    Integer deleteByAppIdAndCorpid(String corpid,Long appId);

    Integer deleteByAppInstallId(@Param("corpid") String corpid, @Param("appInstallId") Long appInstallId);
}
